import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
const app = createApp(App)
// 引入公共组件
import Com from './common'
// 引入封装好的 类型转换参数
import {isKey} from '@/util/common'
// 全局组册组件
for (let i in Com){
  // 先判断，为转化 报错
  if(!isKey(i,Com)){
    throw Error('错了')
  }
    app.component(i,Com[i])
}
// 给vue的实例添加axios
app.config.globalProperties.axios = axios
// 全局引入 element
import ElementPlus from 'element-plus'
// 引入element css样式
import 'element-plus/dist/index.css'
// 引入清楚全局样式
import '@/assets/css/reset.css'
import axios from 'axios'
// icon 全局引入
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 注册element
app.use(store).use(router).use(ElementPlus).mount('#app')
